package com.tea.teawebsite.controller;

import com.tea.teawebsite.entity.Cguser;
import com.tea.teawebsite.mapper.CguserMapper;
import com.tea.teawebsite.mapper.CtypeMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller("/user")
public class CguserController {

    @Resource
    CguserMapper cguserMapper;
    CtypeMapper ctypeMapper;

    @RequestMapping("/login")
    public String show(){
        //用于实现跳转到login.html页面
        return "hlogin";
    }
    @RequestMapping("/main")
    public String main(String usernem,String pwd){
        //用于实现跳转到hmain.html页面
        Map<String, Object> columnMap = new HashMap<>();
        columnMap.put("gname", usernem);
        columnMap.put("gpwd", pwd);
        List<Cguser> cgusers = cguserMapper.selectByMap(columnMap);
        System.out.println("cgusers="+cgusers);
        return "hmain";
    }
@RequestMapping("/shop")
     public String shop(){
        return "shop";

     }


}
